package flextv.search.logic {

internal class QueryParam {
	
	/*
	this._params["vq"] = YoutubeSearch.escape(this._searchTerm); // "vq" 
	this._params["orderby"] = "published";
	this._params["start-index"] = "1"; // 1-based index
	this._params["max-results"] = MAX_RESULT_COUNT;
	this._params["format"] = FORMAT_SWF;
	// category
	// location
	this._params["racy"] = "include"; // include pr0n stuff :)
	*/
	
	private static const MAPPING: Object = {
		_vq: "vq", // ... video query: includes titles, keywords, descriptions, authors' usernames, and categories
		_orderBy: "orderby",
		_startIndex: "start-index",
		_maxResults: "max-results",
		_format: "format",
		// category
		// location
		_racy: "racy"
	};
	
	
	private var _vq: String;
	
	private var _orderBy: String = "published";
	private var _startIndex: int = 1;
	private var _maxResults: int = 50;
	private const _format: int = 5; // 5 ... FORMAT_SWF (1, 6 ... rtsp stuff)
	private var _racy: String = "include"; // include pr0n stuff :)
	
	public function QueryParam() {
		
	}
	
	public function set queryString(value: String): void {
		this._vq = value;
	}
	
	/**
	 * @param fnCallback function signature: callback(key: String, value: Object): void
	 */
	public function forEach(fnCallback: Function): void {
		for (var key: String in MAPPING) {
			fnCallback(MAPPING[key], this[key]);
		}
	}
	
	

}
}